<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">
    <button @click="addVal">按钮</button>
    <ul>
      <li v-for="item in list">{{item}}</li>
    </ul>
  </div>
  <script src="./vue.js"></script>
  <script>
    //  vue 对原声方法进行改造， 让他既可以更新js数据，又可以从新渲染页面
    // pop push shift 
    // let arr = [2, 4, 6]
    // arr.push(8)
    // console.log( arr )

    const vm = new Vue({
      el: '#app',
      data: {
        list: [2, 5, 7]
      },
      methods: {
        addVal() {
          this.list.push(8)
        }
      }
    })
  </script>
</body>
</html>